package com.du.stutestsys.serverImpl.AdministratorImpl;

import com.du.stutestsys.dao.SubjectMapper;
import com.du.stutestsys.entity.Subject;
import com.du.stutestsys.service.Administrator.SubjectService;
import com.du.stutestsys.util.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SubjectServiceImpl implements SubjectService {

    @Autowired
    SubjectMapper subjectMapper;
    @Override
    public boolean addSubject(Subject subject) {
        return subjectMapper.addSubject(subject)>0;
    }

    @Override
    public boolean updateSubject(Subject subject) {
        return subjectMapper.updateSubject(subject)>0;
    }

    @Override
    public List<Subject> selectSubject(Subject subject, PageUtil pageUtil) {
        List<Subject> subjects = subjectMapper.selectSubject(subject, pageUtil);
        return subjects;
    }
}
